﻿@model IEnumerable<FILSTARTUPS_CMS.Models.CategoryPage>
           
@using FILSTARTUPS_CMS.Helpers;

@{
    WebGrid webGrid = new WebGrid(canSort: true, canPage: true, rowsPerPage: 10, ajaxUpdateContainerId: "grid");
    webGrid.Bind(Model, autoSortAndPage: true, rowCount: Model.Count());
    
 }
 
 <div id="grid" class="append-2">
   @webGrid.GetHtml(htmlAttributes: new { id = "grid" },
alternatingRowStyle: "altrow",
mode: WebGridPagerModes.All,
    firstText: "<<first",
    previousText: "<previous",
    nextText: "next >",
    lastText: "last >>",
    columns: webGrid.Columns(
    webGrid.Column("Category Name", "Category Name", format: @<b>@Session_Helper.Truncate(item.categoryname,15)</b>),
   webGrid.Column("Page", "Page", format:@<b>@Session_Helper.Truncate(item.pagetitle,20)</b>),
   webGrid.Column("Display Mode", "Display Mode", format:@<b>@item.enabled</b>),
    webGrid.Column(header: "Action",
            style: "action",
                    format: (item) => new HtmlString(Html.ActionLink("View", "Details", new { id = item.catidPK }) + " | " +
                    Html.ActionLink("Edit", "Edit", new { id = item.catidPK }) 
            ))))

          </div>

<!-- DIALOG BOX 
<div id="dialog-confirm" title="Delete the item?" > 
    <p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span>This item will be deleted. Are you sure?</p> 
</div> 
 END DIALOG BOX -->
